/**
* 频道请求模块
*/
import request from '@/utils/request'

/**
* 获取用户频道列表
*/
export const getUserChannels = () => {
  return request({
    method: 'GET',
    url: '/v1_0/user/channels'
  })
}

/**
* 获取所有频道列表
*/
export const getAllChannels = () => {
  return request({
    method: 'GET',
    url: '/v1_0/channels'
  })
}

/**
* 设置用户频道列表
*/
export const setUserChannels = (channels) => {
  return request({
    method: 'PATCH',
    url: '/v1_0/user/channels',
    data: {
      channels :[channels]
    }
  })
}

/**
* 删除用户频道列表
*/
export const delUserChannels = (value) => {
  return request({
    method: 'DELETE',
    url: `/v1_0/user/channels/${value.id}`
  })
}